4bfd45
@@ -1588,6 +1588,11 @@
private int alterTable(Hive db, AlterTableDesc alterTbl) throws HiveException {
     Partition part = null;
     if(alterTbl.getPartSpec() != null) {
       part = db.getPartition(tbl, alterTbl.getPartSpec(), false);
+      if(part == null) {
+        console.printError("Partition : " + alterTbl.getPartSpec().toString()
+            + " does not exist.");
+        return 1;
+      }
     }
 
     validateAlterTableType(tbl, alterTbl.getOp());
